/*
 *    Copyright (c) 2018-2025, cloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: cloud
 */

package com.fuyao.cloud.asset.purchaseApply.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuyao.cloud.asset.dto.apply.PurchaseapplySearchDTO;
import com.fuyao.cloud.asset.vo.FyAssetPurchaseapplyExcelVO;
import com.fuyao.cloud.common.data.datascope.CloudBaseMapper;
import com.fuyao.cloud.asset.entity.AssetPurchaseapply;
import com.fuyao.cloud.common.data.datascope.DataScope;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 采购申请
 *
 * @author 时间的朋友
 * @date 2021-11-22 13:58:37
 */
@Repository
public interface AssetPurchaseapplyMapper extends CloudBaseMapper<AssetPurchaseapply> {

	List<FyAssetPurchaseapplyExcelVO> listExcel(@Param("query") AssetPurchaseapply fyAssetPurchaseapply);

	/**
	 * 重写采购申请分页对象
	 *
	 * @param page         分页对象
	 * @param queryWrapper 条件构造器
	 * @param dataScope    数据权限
	 * @param searchDTO    参数对象。
	 * @return 采购申请分页
	 */
	IPage page(Page page, @Param(Constants.WRAPPER) Wrapper<AssetPurchaseapply> queryWrapper, DataScope dataScope, @Param("searchDto") PurchaseapplySearchDTO searchDTO);

	/**
	 * 选择的申请单分页方法
	 *
	 * @param page         分页对象
	 * @param queryWrapper 条件构造器
	 * @param dataScope    数据权限
	 * @return 采购申请未被采购主单关联过的采购申请信息
	 */
	IPage getApplyPage(Page page, @Param(Constants.WRAPPER) Wrapper<AssetPurchaseapply> queryWrapper, DataScope dataScope, @Param("searchDto") AssetPurchaseapply searchDTO);

}
